import { Controller, Get, UseGuards, Req, Inject } from '@nestjs/common';
import { AppService } from './app.service';
import { AuthGuard } from '@nestjs/passport';
@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }

  @Get('login')
  @UseGuards(AuthGuard('github'))
  async login() {}

  @Get('dashboard')
  @UseGuards(AuthGuard('github'))
  async dashboard(@Req() req) {
    return { user: req.user };
  }
}
